package com.bihu.bihudemo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bihu.bihudemo.entity.Tag;
import com.bihu.bihudemo.entity.vo.TagVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * (Tag)表数据库访问层
 *
 * @author makejava
 * @since 2020-07-15 17:10:37
 */
public interface TagDao extends BaseMapper<Tag> {

    /**
     * 拿到所有文章
     */
    List<TagVo> selectAll();

    /**
     * 取得相关的文章篇数
     * @return
     */
    @Select("select count(*) from tag_article_link where tid= #{id}")
    int getTag_Related_Num(Tag tag);
}